#include <57header.h>

pthread_spinlock_t  lock;

void *func(void *p){
    sleep(1);

    pthread_spin_lock(&lock);
    printf("son \n");
    pthread_spin_unlock(&lock);

    return NULL;
}
int main(int argc,char*argv[])
{
    pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE);

    pthread_t son_id;
    pthread_create(&son_id, NULL, func, NULL);

    pthread_spin_lock(&lock);
    sleep(200);
    pthread_spin_unlock(&lock);
    
    pthread_join(son_id, NULL);
    pthread_spin_destroy(&lock);

    return 0;
}

